# Makefile for gnuplot LaTeX tutorial
# To make the manual from scratch, we run latex two times

# default target
all: tutorial.dvi

# this tells GNU make not to export variables into the environment
# But other makes dont understand its significance, so it must
# not be the first target in the file. So it is here, before
# any variables are created, but after the default target
.NOEXPORT:

SHELL = /bin/sh
DVIPS = dvips

srcdir = @srcdir@
VPATH = @srcdir@

prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
datadir = $(prefix)/lib
mandir = $(prefix)/man
top_builddir = .
top_srcdir = @top_srcdir@


# To touch it up after changes:
remake: tutorial.dvi

tutorial.ps: tutorial.dvi

tutorial.dvi: eg1.tex eg2.tex eg3.tex eg4.tex eg5.tex eg6.tex linepoin.tex \
	tutorial.tex header.tex
	TEXINPUTS=.:$(srcdir): latex tutorial
	TEXINPUTS=.:$(srcdir): latex tutorial

.SUFFIXES: .dvi .tex .plt .ps

.dvi.ps:
	$(DVIPS) -o $@ $<

.plt.tex:
	@test "$(srcdir)" = "$(top_builddir)" || cp $(srcdir)/*.dat .
	gnuplot $<

clean:
	rm -f *.aux *.dvi *.log *.ps eg?.tex linepoin.tex
	@test "$(srcdir)" = "$(top_builddir)" || rm -f eg?.dat

mostlyclean: clean

distclean: clean
	rm -f Makefile

realclean: distclean
